<?php

	$APPID="wx7287a60bb700fd21";
  $secret= "1ef8755f92bebae8ad7bab432ba29cbf";
  $REDIRECT_URI='http://www.txjava.cn/loginServlet';

	header('Content-Type:application/json; charset=utf-8');


	$access_token = $_POST['access_token'];
	$openid = $_POST['openid'];

		// 2.获取用户信息
		$user_url = 'https://api.weixin.qq.com/sns/userinfo?access_token='.$access_token.'&openid='.$openid;
		$userObj = file_get_contents($user_url);
		exit($userObj);
	

	
	// $str = json_encode($str, JSON_UNESCAPED_UNICODE);



	// function decodeUnicode($str)
	// {
	// 	return preg_replace_callback('/\\\\u([0-9a-f]{4})/i',
	// 		create_function(
	// 			'$matches',
	// 			'return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE");'
	// 		),
	// 		$str);
	// }

	// $str = decodeUnicode($str);

	// $str = json_encode($str);
	// $str = json_decode($str);


	// var_dump($data);

	// 通过调用json_decode()函数，将该JSON字符串转换为一个关联数组：

  // $array = json_decode($data, true);

	// $access_token = $str["access_token"];
	// $openid = $str["openid"];

	//  $data = json_decode($data);




	
?>